#include <fstream>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <string>
#include <vector_types.h>

class Bitmap
{
private:
	unsigned long BPP;
	unsigned int bps;
	unsigned int KompressionFormat;

 public:
	 Bitmap();
	 Bitmap(int, int);
	 Bitmap(const Bitmap&);	// this does NOT copy in the actual RGB data
							// we just need it to set up the headers correctly
	 ~Bitmap();

	 void *LoadBitmap(const char *Filename);
	 void Load8BitKompression(const char *Filename);
	 void Load24BitKompression(const char *Filename);

	unsigned long width;
	unsigned long height;
	unsigned long size;
	unsigned char *bitmap_Image;
 
	 #define BI_RGB   0L
	 #define BI_RLE4  2L 
	 #define BI_RLE8  4L

	 #pragma pack(push,1);
	 //BITMAPFILEHEADER
	 typedef struct 
	 {
	 WORD bfType;
	 DWORD bfSize;
	 DWORD bfReserved;
	 DWORD bfOffBits;
	 }BITMAPFILEHEADER;
 
	 //BITMAPINFOHEADER
	 typedef struct 
	 {
	 DWORD biSize;
	 LONG biWidth;
	 LONG biHeight;
	 WORD biPlanes;
	 WORD biBitCount;
	 DWORD biCompression;
	 DWORD biSizeImage;
	 LONG biXPelsPerMeter;
	 LONG biYPelsPerMeter;
	 DWORD biClrUsed;
	 DWORD biClrImportant;
	 }BITMAPINFOHEADER;

   	 #pragma pack(pop);
 
	 void Kompression();
	 void flush(const char* fileName);
 
	 BITMAPFILEHEADER FileHeader;
	 BITMAPINFOHEADER InfoHeader;
};